//
//  NSThread01.m
//  learn-thread
//
//  Created by srxboys on 2021/4/20.
//

#import "NSThread01.h"

@implementation NSThread01
- (void)runSelector {
    NSThread * thread = [[NSThread alloc] initWithTarget:self selector:@selector(runSelectorMethod) object:nil];
    NSLog(@"--01--runSelector thread= %@, name=%@", thread, thread.name);
    [thread start];
}

- (void)runSelectorMethod {
    NSLog(@"--01---内部--- runSelectorMethod---");
}


- (void)runBlock {
    NSThread * thread = [[NSThread alloc] initWithBlock:^{
        NSLog(@"--01-内部---- runBlock ---");
    }];
    NSLog(@"--01--runBlock thread=%@, name=%@", thread, thread.name);
    [thread start];
}

- (void)run {
    NSLog(@"run run run");
    [self runBlock];
    [self runSelector];
}
@end
